<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="spring" 	uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="tiles" 	uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib prefix="c"		uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" 	uri="http://www.springframework.org/tags/form" %>

<%@ page contentType="text/html; charset=utf-8" %>
<%@ page language="java" pageEncoding="utf-8"%>

<script type="text/javascript">
$(document).ready(function(){
	$("#documentData").kendoDatePicker({
	   	 format: "dd.MM.yyyy"
	   	});  
	
   $("#pRefGift").kendoComboBox({
         index: -1,
         placeholder: "Selectaţi cadou",
         dataTextField: "mdValue",
         dataValueField: "id",
         dataSource: {
             type: "json",
             transport: {
                 read: "stock/listRefGiftCBX"
             }
         }
     });    
     var giftCB = $("#pRefGift").data("kendoComboBox"); 

});

function  submitPJPopup (id) {
	console.log (id);
	
	var returnEn = $("#returnEntity").val();
 	if (returnEn == "ANCHETA") {
 		parent.getRegCompanysApp (id);	
 	} 
 	
 	if (returnEn == "CONTRACT") {
 		parent.getRegCompanysContr(id);	
 	}
 	
	$("#windowClientiPJListPopup").data("kendoWindow").close();
	
};

function addGift(){
	
}

function deleteGift(){
	
}

</script>
<CENTER>
<div class="k-block k-shadow" style="text-align: left;">
	<form:form id="formDocumentCard" method="post" commandName="documentItem" action="stock/stockDocumentCardPopup">
		<ul class="forms" style="font-size: 14px;">
			<li>		
				<label for="id" class="required">Nr. Document :</label>
				<form:input path="id" 				style="width:100px;" 	class="k-textbox"  readonly="true" /> 
			</li>
			<li>		
				<label for="documentData" class="required">Data Document :</label>
				<form:input path="documentData" 	style="width:150px;"  	class="k-textbox"  required="true"/> 
			</li>
			<li>		
				<label for="stockDocumentType.description" class="required">Tip Document :</label>
				<form:input path="stockDocumentType.description" 	style="width:400px;"  	class="k-textbox"  required="true"/> 
			</li>		
			<li>		
				<label for="documentComment" class="required">Comentarii :</label>
				<form:input path="documentComment"  style="width:250px;"  	class="k-textbox"  required="true"/> 
			</li>
			<li>		
				<label for="dtUser.fullName" class="required">Debetor :</label>
				<form:input path="dtUser.fullName" 	style="width:400px;"  	class="k-textbox"  required="true"/> 
			</li>			
			<li>		
				<label for="ctUser.fullName" class="required">Creditor :</label>
				<form:input path="ctUser.fullName" 	style="width:400px;"  	class="k-textbox"  required="true"/> 
			</li>		
		
		</ul>
	</div>
	<div class="k-block k-shadow" >
		<table  width="80%" class="gifts" >
		    <tr>
		    	<th >Cod</th>
		        <th >Denumire</th>
		        <th >Cantitate</th>
		    </tr>
		    <c:forEach items="${documentItem.stockOperation}" var="item" varStatus="status">
		        <tr>
		            <td>			
		            	<label  		for="item${status.index}.value" 	style="width: 50px;">${item.id}</label>
		            	<form:input 	id="item${status.index}.id" 		path="stockOperation[${status.index}].id" style="width:40px;"	/>
		            </td>
		            <td align="left">
		            	<label  for="item${status.index}.value">						${item.refGift.mdValue}</label>	
		            </td>  
		            <td>
		            	<label  for="item${status.index}.value" 	style="width: 50px;">${item.cantitate}</label>		
		            </td>
		            
	<%-- 	            	<form:hidden id="item${status.index}.id" 					path="secUserProcentDetail[${status.index}].id" 	/> --%>
	<%-- 	            	<form:hidden id="item${status.index}.refServices.id" 		path="secUserProcentDetail[${status.index}].refServices.id" 	/> --%>
		            	
	<%-- 	            	<form:input  id="item${status.index}.procent"  			 --%>
	<%-- 	            				path="secUserProcentDetail[${status.index}].procent"   --%>
	<%-- 	            				style="width:40px;"  class="k-textbox"/> --%>
		            	
	<%-- 	            	<form:hidden id="item${status.index}.visualOrder" 		path="secUserProcentDetail[${status.index}].visualOrder" 	/> --%>
		            
		        </tr>
		    </c:forEach>
		</table>
	</form:form>	
	<BR />

	<select id="pRefGift"  style="width:300px;" > </select>	
	<input 	type="text" 	id="pQty" 	style="width:60px;"  class="k-textbox"/> buc.
	<BUTTON onclick="addGift()"> Adauga</BUTTON>
	
	<BR />
</div>				
</CENTER>
<style scoped>
     #formDocumentCard ul {
         list-style-type: none;
         margin: 0;
         padding: 0;
     }
     #formDocumentCard li {
         margin: 10px 0 0 0;
     }

     label {
         display: inline-block;
         width: 300px;
         text-align: right;
     }
     
     input {
     	height: 10px;
     }

     .required {
         font-weight: bold;
     }

     .accept, .status {
         padding-left: 90px;
     }

     .valid {
         color: green;
     }

     .invalid {
         color: red;
     }
     span.k-tooltip {
         margin-left: 6px;
     }
 </style>
 <style type="text/css">
table.gifts {
	border-width: 1px;
	border-spacing: 0px;
	border-style: outset;
	border-color: gray;
	border-collapse: collapse;
/* 	background-color: rgb(255, 255, 240); */
}
table.gifts th {
	border-width: 1px;
	padding: 1px;
	border-style: inset;
	border-color: gray;
 	background-color: #cccccc; 
	-moz-border-radius: ;
}
table.gifts td {
	border-width: 1px;
	padding: 1px;
	border-style: inset;
	border-color: gray;
/* 	background-color: white; */
	-moz-border-radius: ;
}
</style>




